package com.my.fp.maps;

import com.my.bean.User;
import com.my.utils.Utils;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author: marshal
 * @date: 2021-09-06 下午3:03
 */
public class MapTest {
    public static void main(String[] args) {
        var users = Utils.getUsers();
        // 1. 將users列表里的name字段提取为一个新的list
        List<String> names = users.stream().map(User::getName).collect(Collectors.toList());
        System.out.println(names);
    }
}